package com.alm.token.ui.persenter;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.ImageFormat;
import android.graphics.Rect;
import android.graphics.YuvImage;
import android.os.Environment;
import android.util.Log;

import com.alm.token.apinew.AllApi;
import com.alm.token.apinew.BaseObserver;
import com.alm.token.apinew.RetrofitUtil;
import com.alm.token.ui.data.bean.ActiveMioData;
import com.alm.token.ui.data.bean.ActivityDetailData;
import com.alm.token.ui.data.bean.ActivityIndexData;
import com.alm.token.ui.data.bean.ActivityJoinListData;
import com.alm.token.ui.data.bean.AddAppendOrderData;
import com.alm.token.ui.data.bean.AddDrawData;
import com.alm.token.ui.data.bean.AddSubscribeOrderData;
import com.alm.token.ui.data.bean.AddUpCloseVipData;
import com.alm.token.ui.data.bean.BindEmailData;
import com.alm.token.ui.data.bean.BuyHMioAddData;
import com.alm.token.ui.data.bean.BuyHMioIndexData;
import com.alm.token.ui.data.bean.BuyHMioOrderLogData;
import com.alm.token.ui.data.bean.BuyHMioTransIndexData;
import com.alm.token.ui.data.bean.CancelSubScribeOrderData;
import com.alm.token.ui.data.bean.CandyOrderDetilData;
import com.alm.token.ui.data.bean.CandyOrderListData;
import com.alm.token.ui.data.bean.ChannelTypeData;
import com.alm.token.ui.data.bean.CoinDetailData;
import com.alm.token.ui.data.bean.CorwdAddData;
import com.alm.token.ui.data.bean.CorwdIndexData;
import com.alm.token.ui.data.bean.CorwdListData;
import com.alm.token.ui.data.bean.CurrencyChangeData;
import com.alm.token.ui.data.bean.CurrencyChangeIndexData;
import com.alm.token.ui.data.bean.CurrencyChangeListData;
import com.alm.token.ui.data.bean.CurrentOrderData;
import com.alm.token.ui.data.bean.DrawIndexData;
import com.alm.token.ui.data.bean.DrawListData;
import com.alm.token.ui.data.bean.EggPartnerIndexData;
import com.alm.token.ui.data.bean.EggRankingData;
import com.alm.token.ui.data.bean.EggWalletLogData;
import com.alm.token.ui.data.bean.FindMoreData;
import com.alm.token.ui.data.bean.FindMoreNewData;
import com.alm.token.ui.data.bean.FortunePageData;
import com.alm.token.ui.data.bean.FundArealistResponse;
import com.alm.token.ui.data.bean.G12CanData;
import com.alm.token.ui.data.bean.GoogleAuthKeyData;
import com.alm.token.ui.data.bean.HMioMapData;
import com.alm.token.ui.data.bean.InviteFriendsData;
import com.alm.token.ui.data.bean.KuaCurrencyListData;
import com.alm.token.ui.data.bean.LH20orderHistoryData;
import com.alm.token.ui.data.bean.LH2OrderDetailsData;
import com.alm.token.ui.data.bean.LeHuoBaoListData;
import com.alm.token.ui.data.bean.LoginData;
import com.alm.token.ui.data.bean.MessageData;
import com.alm.token.ui.data.bean.MiningWalletTypeIndexData;
import com.alm.token.ui.data.bean.MioOperatorAddOrderData;
import com.alm.token.ui.data.bean.MyIncomeData;
import com.alm.token.ui.data.bean.MyIncomeLogData;
import com.alm.token.ui.data.bean.MyTeamData;
import com.alm.token.ui.data.bean.QuantitativeAShouyiListData;
import com.alm.token.ui.data.bean.QuantitativeBaseChangeData;
import com.alm.token.ui.data.bean.QuotaPageData;
import com.alm.token.ui.data.bean.QuotaWalletIndexData;
import com.alm.token.ui.data.bean.RechargeAddressData;
import com.alm.token.ui.data.bean.RegisterData;
import com.alm.token.ui.data.bean.ShowUserXingjiData;
import com.alm.token.ui.data.bean.StakingHomeData;
import com.alm.token.ui.data.bean.StakingMiningMoneyDrawIndexData;
import com.alm.token.ui.data.bean.StakingOrderAddData;
import com.alm.token.ui.data.bean.StakingOrderAppendData;
import com.alm.token.ui.data.bean.StakingOrderHistoryData;
import com.alm.token.ui.data.bean.StakingOrderIndexData;
import com.alm.token.ui.data.bean.SubscribeOrderListData;
import com.alm.token.ui.data.bean.SuperColorEggData;
import com.alm.token.ui.data.bean.TransferTransData;
import com.alm.token.ui.data.bean.UpdateData;
import com.alm.token.ui.data.bean.UserData;
import com.alm.token.ui.data.bean.UserListLHData;
import com.alm.token.ui.data.bean.UserPayAdressData;
import com.alm.token.ui.data.bean.UserWalletData;
import com.alm.token.ui.data.bean.VipOrderListData;
import com.alm.token.ui.data.bean.WalletLogDetaiData;
import com.alm.token.ui.data.bean.ZhuijiashowData;
import com.alm.token.ui.view.ActivityView;
import com.alm.token.ui.view.BaseView;
import com.alm.token.ui.view.BindEmailView;
import com.alm.token.ui.view.BindGoogleCodeView;
import com.alm.token.ui.view.BuyHMioView;
import com.alm.token.ui.view.CandyView;
import com.alm.token.ui.view.CurrencyChangeView;
import com.alm.token.ui.view.EggPartnerView;
import com.alm.token.ui.view.ExchangeQuotaView;
import com.alm.token.ui.view.FortunePageView;
import com.alm.token.ui.view.FundArealistView;
import com.alm.token.ui.view.KuaCurrencyView;
import com.alm.token.ui.view.LeHuoBaoView;
import com.alm.token.ui.view.MainView;
import com.alm.token.ui.view.MineView;
import com.alm.token.ui.view.PayPswView;
import com.alm.token.ui.view.QuantitativeOrder2View;
import com.alm.token.ui.view.QuantitativeOrderOpenAddView;
import com.alm.token.ui.view.RegisterView;
import com.alm.token.ui.view.ShouyiView;
import com.alm.token.ui.view.StakingView;
import com.alm.token.ui.view.SubscribleOrderEggView;
import com.alm.token.ui.view.SuperColorEggView;
import com.alm.token.ui.view.TurmOutView;
import com.alm.token.ui.view.UpdataView;
import com.alm.token.ui.view.UserWalletView;
import com.alm.token.ui.view.VipApplyView;
import com.alm.token.utils.EmptyUtils;
import com.alm.token.utils.LogUtil;
import com.alm.token.utils.SignForInster;
import com.alm.token.utils.StringUtils;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.http.Field;
import rx.functions.Func1;

/**
 * Created by PDD on 2017/12/22.
 */

public class MyPreenter extends BasePresenter {

    public AllApi apiStores = RetrofitUtil.getInstance().initRetrofit();
    public String key = "tmdshuijieshuishabi";

    private BaseView baseView;
    private RegisterView registerView;
    private VipApplyView vipApplyView;
    private QuantitativeOrderOpenAddView quantitativeOrderOpenAddView;
    private CurrencyChangeView currencyChangeView;
    private UserWalletView userWalletView;
    private LeHuoBaoView leHuoBaoView;

    private TurmOutView turmOutView;
    private MineView mineView;
    private CandyView candyView;

    private FundArealistView fundArealistView;
    private ShouyiView shouyiView;
    private SuperColorEggView superColorEggView;
    private EggPartnerView eggPartnerView;
    private ActivityView activityView;
    private PayPswView payPswView;
    private QuantitativeOrder2View quantitativeOrder2View;
    private FortunePageView fortunePageView;
    private BindGoogleCodeView bindGoogleCodeView;
    private BindEmailView bindEmailView;
    private MainView mainView;
    private StakingView stakingView;
    private UpdataView updataView;
    private SubscribleOrderEggView subscribleOrderEggView;
    private KuaCurrencyView kuaCurrencyView;
    private BuyHMioView buyHMioView;
    private ExchangeQuotaView exchangeQuotaView;

    public MyPreenter(BaseView baseView) {
        this.baseView = baseView;
    }

    public MyPreenter(UpdataView updataView) {
        this.updataView = updataView;
    }

    public MyPreenter(BuyHMioView buyHMioView) {
        this.buyHMioView = buyHMioView;
    }

    public MyPreenter(MainView mainView) {
        this.mainView = mainView;
    }

    public MyPreenter(StakingView stakingView) {
        this.stakingView = stakingView;
    }

    public MyPreenter(BindEmailView bindEmailView) {
        this.bindEmailView = bindEmailView;
    }

    public MyPreenter(BindGoogleCodeView bindGoogleCodeView) {
        this.bindGoogleCodeView = bindGoogleCodeView;
    }

    public MyPreenter(RegisterView registerView) {
        this.registerView = registerView;
    }

    public MyPreenter(VipApplyView vipApplyView) {
        this.vipApplyView = vipApplyView;
    }

    public MyPreenter(QuantitativeOrderOpenAddView quantitativeOrderOpenAddView) {
        this.quantitativeOrderOpenAddView = quantitativeOrderOpenAddView;
    }

    public MyPreenter(LeHuoBaoView leHuoBaoView) {
        this.leHuoBaoView = leHuoBaoView;
    }

    public MyPreenter(CurrencyChangeView currencyChangeView) {
        this.currencyChangeView = currencyChangeView;
    }

    public MyPreenter(UserWalletView userWalletView) {
        this.userWalletView = userWalletView;
    }

    public MyPreenter(TurmOutView turmOutView) {
        this.turmOutView = turmOutView;
    }

    public MyPreenter(MineView mineView) {
        this.mineView = mineView;
    }

    public MyPreenter(CandyView candyView) {
        this.candyView = candyView;
    }

    public MyPreenter(FundArealistView fundArealistView) {
        this.fundArealistView = fundArealistView;
    }

    public MyPreenter(ShouyiView shouyiView) {
        this.shouyiView = shouyiView;
    }

    public MyPreenter(SuperColorEggView superColorEggView) {
        this.superColorEggView = superColorEggView;
    }

    public MyPreenter(EggPartnerView eggPartnerView) {
        this.eggPartnerView = eggPartnerView;
    }

    public MyPreenter(ActivityView activityView) {
        this.activityView = activityView;
    }

    public MyPreenter(PayPswView payPswView) {
        this.payPswView = payPswView;
    }

    public MyPreenter(QuantitativeOrder2View quantitativeOrder2View) {
        this.quantitativeOrder2View = quantitativeOrder2View;
    }

    public MyPreenter(FortunePageView fortunePageView) {
        this.fortunePageView = fortunePageView;
    }

    public MyPreenter(SubscribleOrderEggView subscribleOrderEggView) {
        this.subscribleOrderEggView = subscribleOrderEggView;
    }

    public MyPreenter(KuaCurrencyView kuaCurrencyView) {
        this.kuaCurrencyView = kuaCurrencyView;
    }

    public MyPreenter(ExchangeQuotaView exchangeQuotaView) {
        this.exchangeQuotaView = exchangeQuotaView;
    }


    /**
     * 登录获取token
     *
     * @param username
     * @param pwd
     * @return
     */
    public void getLoginData(String username, String pwd) {
        baseView.ShowProgress();

        Log.e("请求", username + "  " + pwd + "  ");

//        Map<String, String> parm = new HashMap<>();
//        parm.put("username", username);
//        parm.put("pwd", pwd);

//        String sign = new SignForInster().signForInspiry(parm, key);
//        String timestamp = String.valueOf((new Date()).getTime());

        apiStores.getLoginData(username, pwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<LoginData>() {
                    @Override
                    protected void onSuccees(LoginData model) throws Exception {
                        baseView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            baseView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        baseView.getData(model);


//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        baseView.hideProgress();
                        baseView.onError(e.toString());
                    }
                });
    }

    public static final String pay = "pay";// 支付类验证码
    public static final String register = "register";  //注册
    //    public static final String back_password = "back_password";  // 重置密码
    public static final String check = "check";  //修改手机号
//    public static final String update_password = "update_password";  //修改密码
//    public static final String update_pay_password = "update_pay_password";  //修改支付密码
//    public static final String add_pay_password = "add_pay_password";  //添加支付密码
//    public static final String back_pay_password = "back_pay_password";  //找回支付密码

    public static final String bind_mail = "bind_mail";//为用户绑定邮箱
    public static final String change_mail = "change_mail";//邮箱更换
    public static final String back_password = "back_password";//为修改密码
    public static final String add_pay_password = "add_pay_password";//设置支付密码
    public static final String update_pay_password = "update_pay_password";//修改支付密码
    public static final String back_pay_password = "back_pay_password";//找回支付密码
    public static final String draw = "withdraw_deposit";//提现
    public static final String currency_change = "currency_change";//币种互转
    public static final String update_password = "update_password";//修改登录密码
    public static final String get_mnemonic = "get_mnemonic";//获取助记词

    /**
     * 获取短信验证码
     *
     * @param mobile
     * @param key
     * @param isCheckRegister
     * @return
     */
    public void getSmsCodeData(String mobile, String key, String isCheckRegister) {
        if (registerView != null) {
            registerView.ShowProgress();
        }
        if (turmOutView != null) {
            turmOutView.ShowProgress();
        }
        if (payPswView != null) {
            payPswView.ShowProgress();
        }

        Log.e("请求", mobile + "  " + key + "  " + isCheckRegister + "  ");
        apiStores.getSmsCodeData(mobile, key, isCheckRegister)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (registerView != null) {
                            registerView.hideProgress();
                            registerView.getCode(model);
                        }
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            turmOutView.getCode(model);
                        }
                        if (payPswView != null) {
                            payPswView.hideProgress();
                            payPswView.getCode(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (registerView != null) {
                            registerView.hideProgress();
                            registerView.onError(e.toString());
                        }
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            turmOutView.onError(e.toString());
                        }
                        if (payPswView != null) {
                            payPswView.hideProgress();
                            payPswView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 获取短信验证码
     *
     * @param mobile
     * @param key
     * @param isCheckRegister
     * @return
     */
    public void getSmsCode1Data(String mobile, String key, String isCheckRegister, String pcode) {
        if (registerView != null) {
            registerView.ShowProgress();
        }
        if (turmOutView != null) {
            turmOutView.ShowProgress();
        }
        if (payPswView != null) {
            payPswView.ShowProgress();
        }

        Log.e("请求", mobile + "  " + key + "  " + isCheckRegister + "  ");
        apiStores.getSmsCode1Data(mobile, key, isCheckRegister, pcode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (registerView != null) {
                            registerView.hideProgress();
                            registerView.getCode(model);
                        }
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            turmOutView.getCode(model);
                        }
                        if (payPswView != null) {
                            payPswView.hideProgress();
                            payPswView.getCode(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (registerView != null) {
                            registerView.hideProgress();
                            registerView.onError(e.toString());
                        }
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            turmOutView.onError(e.toString());
                        }
                        if (payPswView != null) {
                            payPswView.hideProgress();
                            payPswView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 获取谷歌验证码
     */
    public void getGoogleAuthKey() {
        bindGoogleCodeView.ShowProgress();
        apiStores.getGoogleAuthKey()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<GoogleAuthKeyData>() {
                    @Override
                    protected void onSuccees(GoogleAuthKeyData model) throws Exception {
                        bindGoogleCodeView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            bindGoogleCodeView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        bindGoogleCodeView.getGoogleAuthKey(model);
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        bindGoogleCodeView.hideProgress();
                        bindGoogleCodeView.onError(e.toString());
                    }
                });
    }

    /**
     * 绑定谷歌验证码
     */
    public void bindGoogleSecretKey(String code) {
        bindGoogleCodeView.ShowProgress();
        apiStores.bindGoogleSecretKey(code)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<GoogleAuthKeyData>() {
                    @Override
                    protected void onSuccees(GoogleAuthKeyData model) throws Exception {
                        bindGoogleCodeView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            bindGoogleCodeView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        bindGoogleCodeView.bindGoogleSecretKey(model);
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        bindGoogleCodeView.hideProgress();
                        bindGoogleCodeView.onError(e.toString());
                    }
                });
    }

    /**
     * 绑定谷歌验证码
     */
    public void unbindGoogleSecretKey(String code) {
        if (bindGoogleCodeView != null) {
            bindGoogleCodeView.ShowProgress();
        }
        if (mainView != null) {
            mainView.ShowProgress();
        }

        apiStores.unbindGoogleSecretKey(code)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<GoogleAuthKeyData>() {
                    @Override
                    protected void onSuccees(GoogleAuthKeyData model) throws Exception {
                        if (bindGoogleCodeView != null)
                            bindGoogleCodeView.hideProgress();
                        if (mainView != null)
                            mainView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            if (bindGoogleCodeView != null)
                                bindGoogleCodeView.jumpToLoginAct(model.getStatus());
                            if (mainView != null)
                                mainView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        if (bindGoogleCodeView != null)
                            bindGoogleCodeView.unbindGoogleSecretKey(model);
                        if (mainView != null)
                            mainView.unbindGoogleSecretKey(model);
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (bindGoogleCodeView != null) {
                            bindGoogleCodeView.hideProgress();
                            bindGoogleCodeView.onError(e.toString());
                        }
                        if (mainView != null) {
                            mainView.hideProgress();
                            mainView.onError(e.toString());
                        }

                    }
                });
    }

    /**
     * 发送邮箱验证码
     *
     * @param email 收件地址
     * @param key   邮件发送类型  "bind_mail"为用户绑定邮箱    "change_mail"邮箱更换    "back_password"为修改密码
     *              "add_pay_password" 设置支付密码    "update_pay_password"修改支付密码    "back_pay_password"找回支付密码
     *              "draw"提现    "currency_change"币种互转    "update_password": 修改登录密码    "get_mnemonic":获取助记词
     * @return
     */
    public void sendMailCode(String email, String key) {
        if (bindEmailView != null) {
            bindEmailView.ShowProgress();
        }
        if (payPswView != null) {
            payPswView.ShowProgress();
        }

        apiStores.sendMailCode(email, key)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (bindEmailView != null)
                            bindEmailView.hideProgress();
                        if (payPswView != null)
                            payPswView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            if (bindEmailView != null)
                                bindEmailView.jumpToLoginAct(model.getStatus());
                            if (payPswView != null)
                                payPswView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        if (bindEmailView != null)
                            bindEmailView.sendMailCode(model);
                        if (payPswView != null)
                            payPswView.sendMailCode(model);
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (bindEmailView != null) {
                            bindEmailView.hideProgress();
                            bindEmailView.onError(e.toString());
                        }
                        if (payPswView != null) {
                            payPswView.hideProgress();
                            payPswView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 邮箱验证码验证
     *
     * @param email
     * @param message
     * @param type
     * @param payPwd
     * @return
     */
    public void verifyCode(String email, String message,
                           String type, String payPwd) {
        if (bindEmailView != null) {
            bindEmailView.ShowProgress();
        }

        apiStores.verifyCode(email, message, type, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (bindEmailView != null)
                            bindEmailView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            if (bindEmailView != null)
                                bindEmailView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        if (bindEmailView != null)
                            bindEmailView.getData(model);
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (bindEmailView != null) {
                            bindEmailView.hideProgress();
                            bindEmailView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 发送邮箱验证码
     *
     * @param email 收件地址
     * @param key   邮件发送类型  "bind_mail"为用户绑定邮箱    "change_mail"邮箱更换    "back_password"为修改密码
     *              "add_pay_password" 设置支付密码    "update_pay_password"修改支付密码    "back_pay_password"找回支付密码
     *              "draw"提现    "currency_change"币种互转    "update_password": 修改登录密码    "get_mnemonic":获取助记词
     * @return
     */
    public void getSmsCodeData(String email, String key) {
        if (registerView != null) {
            registerView.ShowProgress();
        }
        if (turmOutView != null) {
            turmOutView.ShowProgress();
        }
        if (payPswView != null) {
            payPswView.ShowProgress();
        }
        if (activityView != null) {
            activityView.ShowProgress();
        }
        if (mainView != null) {
            mainView.ShowProgress();
        }

        apiStores.sendMailCode(email, key)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (registerView != null) {
                            registerView.hideProgress();
                            registerView.getCode(model);
                        }
                        if (mainView != null) {
                            mainView.hideProgress();
                            mainView.getCode(model);
                        }
                        if (activityView != null) {
                            activityView.hideProgress();
                            activityView.getCode(model);
                        }
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            turmOutView.getCode(model);
                        }
                        if (payPswView != null) {
                            payPswView.hideProgress();
                            payPswView.getCode(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (registerView != null) {
                            registerView.hideProgress();
                            registerView.onError(e.toString());
                        }
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            turmOutView.onError(e.toString());
                        }
                        if (mainView != null) {
                            mainView.hideProgress();
                            mainView.onError(e.toString());
                        }
                        if (activityView != null) {
                            activityView.hideProgress();
                            activityView.onError(e.toString());
                        }
                        if (payPswView != null) {
                            payPswView.hideProgress();
                            payPswView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 绑定邮箱
     *
     * @param email    邮箱
     * @param message  邮箱验证码
     * @param key      "bind_mail"用户绑定邮箱
     * @param payPwd   有设置过支付密码
     * @param country  国家名称
     * @param areacode 国家区号
     * @return
     */
    public void bindMail(String email, String message, String key, String mnemonic,
                         String payPwd, String country, String areacode) {
        bindEmailView.ShowProgress();
        apiStores.bindMail(email, message, key, mnemonic, payPwd, country, areacode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<BindEmailData>() {
                    @Override
                    protected void onSuccees(BindEmailData model) throws Exception {
                        bindEmailView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            bindEmailView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        bindEmailView.bindMail(model);
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        bindEmailView.hideProgress();
                        bindEmailView.onError(e.toString());
                    }
                });
    }

    /**
     * 邮箱更换
     *
     * @param oldMail 邮箱
     * @param oldMsg  邮箱验证码
     * @param newMail
     * @param newMsg
     * @return
     */
    public void upMail(String oldMail, String oldMsg, String newMail, String newMsg) {
        bindEmailView.ShowProgress();
        apiStores.upMail(oldMail, oldMsg, newMail, newMsg)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        bindEmailView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            bindEmailView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        bindEmailView.upMail(model);
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        bindEmailView.hideProgress();
                        bindEmailView.onError(e.toString());
                    }
                });
    }

    /**
     * 获取助记词
     *
     * @param googleCode 金额
     * @param verifyCode 验证码
     * @param payPwd     支付密码
     * @return
     */
    public void getMnemonic(String verifyCode, String payPwd, String googleCode) {

        if (mainView != null) {
            mainView.ShowProgress();
        }

        apiStores.getMnemonic(verifyCode, payPwd, googleCode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<GoogleAuthKeyData>() {
                    @Override
                    protected void onSuccees(GoogleAuthKeyData model) throws Exception {

                        if (mainView != null) {
                            mainView.hideProgress();
                            mainView.getMonic(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (mainView != null) {
                            mainView.hideProgress();
                            mainView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 获取图形验证码
     *
     * @return
     */
    public void getcreateCodeData() {
        if (registerView != null) {
            registerView.ShowProgress();
        }

        Call<ResponseBody> call = apiStores.getcreateCodeData();
        call.enqueue(new Callback<ResponseBody>() {

            @Override
            public void onResponse(Call<ResponseBody> call, retrofit2.Response<ResponseBody> response) {
                if (registerView != null) {
                    registerView.hideProgress();
                    Bitmap bitmap = null;
                    try {
                        byte[] content = response.body().bytes();
                        StringBuffer stringBuffer = new StringBuffer();

                        for (Byte bi : content) {
                            stringBuffer.append(bi + " ");
                        }
                        LogUtil.e("response_content=" + stringBuffer.toString());

                        bitmap = BitmapFactory.decodeByteArray(content, 0, content.length);

                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    registerView.getcreateCode(bitmap);
                }

            }

            @Override
            public void onFailure(Call<ResponseBody> call, Throwable t) {
                if (registerView != null) {
                    registerView.hideProgress();
                    registerView.onError(t.toString());
                }
            }
        });
    }


    /**
     * 16进制的字符串表示转成字节数组
     *
     * @param hexString 16进制格式的字符串
     * @return 转换后的字节数组
     **/
    public static byte[] toByteArray(String hexString) {
        if (StringUtils.isEmpty(hexString))
            throw new IllegalArgumentException("this hexString must not be empty");

        hexString = hexString.toLowerCase();
        final byte[] byteArray = new byte[hexString.length() / 2];
        int k = 0;
        for (int i = 0; i < byteArray.length; i++) {//因为是16进制，最多只会占用4位，转换成字节需要两个16进制的字符，高位在先
            byte high = (byte) (Character.digit(hexString.charAt(k), 16) & 0xff);
            byte low = (byte) (Character.digit(hexString.charAt(k + 1), 16) & 0xff);
            byteArray[i] = (byte) (high << 4 | low);
            k += 2;
        }
        return byteArray;
    }

    /**
     * 字节数组转成16进制表示格式的字符串
     *
     * @param byteArray 需要转换的字节数组
     * @return 16进制表示格式的字符串
     **/
    public static String toHexString(byte[] byteArray) {
        if (byteArray == null || byteArray.length < 1)
            throw new IllegalArgumentException("this byteArray must not be null or empty");

        final StringBuilder hexString = new StringBuilder();
        for (int i = 0; i < byteArray.length; i++) {
            if ((byteArray[i] & 0xff) < 0x10)//0~F前面不零
                hexString.append("0");
            hexString.append(Integer.toHexString(0xFF & byteArray[i]));
        }
        return hexString.toString().toLowerCase();
    }

    /**
     * bitmap转化为bgr数据，格式为{@link Bitmap.Config#ARGB_8888}
     *
     * @param image 传入的bitmap
     * @return bgr数据
     */
    public static byte[] bitmapToBgr(Bitmap image) {
        if (image == null) {
            return null;
        }
        int bytes = image.getByteCount();

        ByteBuffer buffer = ByteBuffer.allocate(bytes);
        image.copyPixelsToBuffer(buffer);
        byte[] temp = buffer.array();
        byte[] pixels = new byte[(temp.length / 4) * 3];
        for (int i = 0; i < temp.length / 4; i++) {
            pixels[i * 3] = temp[i * 4 + 2];
            pixels[i * 3 + 1] = temp[i * 4 + 1];
            pixels[i * 3 + 2] = temp[i * 4];
        }
        return pixels;
    }

    /**
     * 注册
     *
     * @param phone
     * @param pwd
     * @param message
     * @param username
     * @param code
     * @return
     */
    public void getRegisterData(String phone, String pwd, String message,
                                String username, String code) {
        phone = replaceBlank(phone);
        pwd = replaceBlank(pwd);
        message = replaceBlank(message);

        username = replaceBlank(username);
        code = replaceBlank(code);

        registerView.ShowProgress();
        Log.e("请求", phone + "  " + pwd + "  " + message + "  " + username + "  " + code);
        apiStores.getRegisterData(phone, pwd, message, username, code)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        registerView.hideProgress();
                        registerView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        registerView.hideProgress();
                        registerView.onError(e.toString());
                    }
                });

    }

    /**
     * 注册
     *
     * @param pwd
     * @param message
     * @param username
     * @param code
     * @param mnemonic
     * @return
     */
    public void getRegistermailData(String pwd, String message, String username, String code, String mnemonic) {
        pwd = replaceBlank(pwd);
        message = replaceBlank(message);
        username = replaceBlank(username);
        code = replaceBlank(code);

        registerView.ShowProgress();

        apiStores.getRegistermailData(pwd, message, username, code, mnemonic)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        registerView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            registerView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        registerView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        registerView.hideProgress();
                        registerView.onError(e.toString());
                    }
                });

    }


    /**
     * 重置密码
     *
     * @param pwd
     * @param mnemonic
     * @return
     */
    public void getmodfixMyPwdData(String pwd, String mnemonic) {
        registerView.ShowProgress();

        apiStores.getupdatePwd(pwd, mnemonic)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        registerView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            registerView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        registerView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        registerView.hideProgress();
                        registerView.onError(e.toString());
                    }
                });
    }

    /**
     * 修改登录密码
     *
     * @param oldPwd
     * @param newPwd
     * @param newPwdSecond
     * @param verifyCode
     * @return
     */
    public void getmodfixMyPwdData(String oldPwd, String newPwd, String newPwdSecond, String verifyCode) {

        oldPwd = replaceBlank(oldPwd);
        newPwd = replaceBlank(newPwd);
        newPwdSecond = replaceBlank(newPwdSecond);
        verifyCode = replaceBlank(verifyCode);

        registerView.ShowProgress();
        Log.e("请求", oldPwd + "  " + newPwd + "  " + newPwdSecond + "  " + verifyCode);
        apiStores.getupdateLoginPwdData(oldPwd, newPwd, newPwdSecond, verifyCode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        registerView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            registerView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        registerView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        registerView.hideProgress();
                        registerView.onError(e.toString());
                    }
                });
    }

    /**
     * 检测是否设置了支付密码
     *
     * @return // "data": 1, 1 有 0 没有
     */
    public void getHavePayPwd() {
        payPswView.ShowProgress();
        apiStores.getHavePayPwd()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        payPswView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            payPswView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        payPswView.getHavePayPwd(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        payPswView.hideProgress();
                        payPswView.onError(e.toString());
                    }
                });
    }


    /**
     * 添加支付密码
     *
     * @param pwd        密码1
     * @param secondPwd  密码2
     * @param verifyCode 验证码
     * @return
     */
    public void getAddPayPwdData(String pwd, String secondPwd, String verifyCode) {
        payPswView.ShowProgress();
        apiStores.getAddPayPwdData(pwd, secondPwd, verifyCode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        payPswView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            payPswView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        payPswView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        payPswView.hideProgress();
                        payPswView.onError(e.toString());
                    }
                });
    }

    /**
     * 修改支付密码
     *
     * @param oldPwd       old密码
     * @param newPwd       密码1
     * @param newPwdSecond 密码2
     * @param verifyCode   验证码
     * @return
     */
    public void getEditPayPwdData(String oldPwd, String newPwd, String newPwdSecond, String verifyCode) {
        payPswView.ShowProgress();
        apiStores.getEditPayPwdData(oldPwd, newPwd, newPwdSecond, verifyCode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        payPswView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            payPswView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        payPswView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        payPswView.hideProgress();
                        payPswView.onError(e.toString());
                    }
                });
    }

    /**
     * 支付密码找回
     *
     * @param pwd        old密码
     * @param secondPwd  密码1
     * @param authCode   密码2
     * @param verifyCode 验证码
     * @return
     */
    public void getPayPwdGetBackData(String pwd, String secondPwd, String authCode, String verifyCode) {
        payPswView.ShowProgress();
        apiStores.getPayPwdGetBackData(pwd, secondPwd, authCode, verifyCode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        payPswView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            payPswView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        payPswView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        payPswView.hideProgress();
                        payPswView.onError(e.toString());
                    }
                });
    }

    /**
     * 更换手机号
     *
     * @param oldMobile
     * @param oldCode
     * @param newMobile
     * @param newCode
     * @param pwd
     * @return
     */
    public void changePhoneData(String oldMobile, String oldCode,
                                String newMobile, String newCode,
                                String pwd) {

        oldMobile = replaceBlank(oldMobile);
        pwd = replaceBlank(pwd);
        oldCode = replaceBlank(oldCode);

        newMobile = replaceBlank(newMobile);
        newCode = replaceBlank(newCode);

        registerView.ShowProgress();
        Log.e("请求", oldMobile + "  " + oldCode + "  " + newMobile + "  " + newCode + "  " + pwd);
        apiStores.changePhoneData(oldMobile, oldCode, newMobile, newCode, pwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        registerView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            registerView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        registerView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        registerView.hideProgress();
                        registerView.onError(e.toString());
                    }
                });
    }


    /**
     * 获取我的_数据
     *
     * @return
     */
    public void getMineData() {
        mineView.ShowProgress();
        apiStores.getMineData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<UserData>() {
                    @Override
                    protected void onSuccees(UserData model) throws Exception {
                        mineView.hideProgress();
                        //status返回为4的提示设置支付密码
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            mineView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        mineView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        mineView.hideProgress();
                        mineView.onError(e.toString());
                    }
                });
    }

    /**
     * 我的社群_数据
     *
     * @return
     */
    public void getMyTeamData() {
//        mineView.ShowProgress();
        apiStores.getMyTeamData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<MyTeamData>() {
                    @Override
                    protected void onSuccees(MyTeamData model) throws Exception {
                        mineView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            mineView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        mineView.getMyTeamData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        mineView.hideProgress();
                        mineView.onError(e.toString());
                    }
                });
    }


    /**
     * 我的收益_数据
     * AGO 量化 STK 挖矿
     *
     * @return
     */
    public void getMyIncomeData(String type) {
        shouyiView.ShowProgress();
        apiStores.getMyIncomeData(type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<MyIncomeData>() {
                    @Override
                    protected void onSuccees(MyIncomeData model) throws Exception {
                        shouyiView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            shouyiView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        shouyiView.getmyIncomeData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        shouyiView.hideProgress();
                        shouyiView.onError(e.toString());
                    }
                });
    }

    /**
     * 我的收益详情_数据
     *
     * @return
     */
    public void getMyIncomeLogData(String page, String limit, String channelType) {
        shouyiView.ShowProgress();
        apiStores.getMyIncomeLogData(page, limit, channelType)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<MyIncomeLogData>() {
                    @Override
                    protected void onSuccees(MyIncomeLogData model) throws Exception {
                        shouyiView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            shouyiView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        shouyiView.getmyIncomeLogData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        shouyiView.hideProgress();
                        shouyiView.onError(e.toString());
                    }
                });
    }

    /**
     * 首页钱包数据
     *
     * @param
     * @param
     */
    public void getUserWalletData() {
        userWalletView.ShowProgress();

        apiStores.getUserWalletData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<UserWalletData>() {
                    @Override
                    protected void onSuccees(UserWalletData model) throws Exception {
                        userWalletView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            userWalletView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        userWalletView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        userWalletView.hideProgress();
                        userWalletView.onError(e.toString());
                    }
                });
    }


    /**
     * 跨币币种列表
     *
     * @param
     * @param
     */
    public void getKuaWalletsData(String type) {
        kuaCurrencyView.ShowProgress();
        apiStores.getKuaWalletsData(type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<KuaCurrencyListData>() {
                    @Override
                    protected void onSuccees(KuaCurrencyListData model) throws Exception {
                        kuaCurrencyView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            kuaCurrencyView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        kuaCurrencyView.getData(model);
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        kuaCurrencyView.hideProgress();
                        kuaCurrencyView.onError(e.toString());
                    }
                });
    }


    /**
     * 首页钱包数据
     *
     * @param
     * @param
     */
    public void getFindMoreDataNew() {
        payPswView.ShowProgress();
        apiStores.getFindMoreDataNew()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<FindMoreNewData>() {
                    @Override
                    protected void onSuccees(FindMoreNewData model) throws Exception {
                        payPswView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            payPswView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        payPswView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        payPswView.hideProgress();
                        payPswView.onError(e.toString());
                    }
                });
    }

    /**
     * 财富 首页数据
     *
     * @return
     */
    public void getLH2OrderHomeData() {
        fortunePageView.ShowProgress();

        apiStores.getLH2OrderHomeData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<FortunePageData>() {
                    @Override
                    protected void onSuccees(FortunePageData model) throws Exception {
                        fortunePageView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            fortunePageView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        fortunePageView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        fortunePageView.hideProgress();
                        fortunePageView.onError(e.toString());
                    }
                });
    }


    /**
     * 财富  AGO历史数据
     *
     * @return
     */
    public void getLH2OorderHistoryData(String limit, String page) {
        fortunePageView.ShowProgress();
        apiStores.getLH2OorderHistoryData(page, limit)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<LH20orderHistoryData>() {
                    @Override
                    protected void onSuccees(LH20orderHistoryData model) throws Exception {
                        fortunePageView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            fortunePageView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        fortunePageView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        fortunePageView.hideProgress();
                        fortunePageView.onError(e.toString());
                    }
                });
    }

    /**
     * staking 挖矿staking首页
     *
     * @return
     */
    public void getStakingHomeData() {
        stakingView.ShowProgress();

        apiStores.getStakingHomeData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<StakingHomeData>() {
                    @Override
                    protected void onSuccees(StakingHomeData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }

    /**
     * staking 挖矿staking首页
     *
     * @return
     */
    public void getStakingOrderIndexData(String moneyType, String orderSn) {
        stakingView.ShowProgress();

        apiStores.getStakingOrderIndexData(moneyType, orderSn)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<StakingOrderIndexData>() {
                    @Override
                    protected void onSuccees(StakingOrderIndexData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }

    /**
     * staking 挖矿staking首页
     *
     * @return
     */
    public void getStakingAddOrderData(String moneyType, String money, String payPwd) {
        stakingView.ShowProgress();

        apiStores.getStakingAddOrderData(moneyType, money, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<StakingOrderAddData>() {
                    @Override
                    protected void onSuccees(StakingOrderAddData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getStakingAddOrderData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }

    /**
     * staking 挖矿staking首页
     *
     * @return
     */
    public void getStakingCancelQueuingData(String orderSn, String payPwd) {
        stakingView.ShowProgress();

        apiStores.getStakingCancelQueuingData(orderSn, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getStakingCancelQueuingData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }

    /**
     * staking 支付挖矿订单
     *
     * @return
     */
    public void getStakingPayOrderData(String orderSn, String payPwd) {
        stakingView.ShowProgress();

        apiStores.getStakingPayOrderData(orderSn, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getStakingPayOrderData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }

    /**
     * staking 支付挖矿订单
     *
     * @return
     */
    public void getStakingAppendOrderData(String orderSn, String moneyType, String money) {
        stakingView.ShowProgress();

        apiStores.getStakingAppendOrderData(orderSn, moneyType, money)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<StakingOrderAppendData>() {
                    @Override
                    protected void onSuccees(StakingOrderAppendData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getStakingOrderAppendData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }

    /**
     * staking 支付挖矿订单
     *
     * @return
     */
    public void getStakingCloseAllOrderData(String orderSn) {
        stakingView.ShowProgress();

        apiStores.getStakingCloseAllOrderData(orderSn)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<StakingOrderAppendData>() {
                    @Override
                    protected void onSuccees(StakingOrderAppendData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getStakingOrderAppendData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }

    /**
     * staking 支付挖矿订单
     *
     * @return
     */
    public void getStakingCloseOrderByMoneyData(RequestBody requestBody) {
        stakingView.ShowProgress();

        apiStores.getStakingCloseOrderByMoneyData(requestBody)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<StakingOrderAppendData>() {
                    @Override
                    protected void onSuccees(StakingOrderAppendData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getStakingOrderAppendData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }


    /**
     * staking 支付挖矿订单
     *
     * @return
     */
    public void getStakingOrderListData(String limit, String page) {
        stakingView.ShowProgress();

        apiStores.getStakingOrderListData(page, limit)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<StakingOrderHistoryData>() {
                    @Override
                    protected void onSuccees(StakingOrderHistoryData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }


    /**
     * staking 支付挖矿订单
     *
     * @return
     */
    public void getStakingOrderIncomeListData(String orderSn, String limit, String page,
                                              String channelType, String incomeType, String moneyType) {
        stakingView.ShowProgress();

        apiStores.getStakingOrderIncomeListData(orderSn, page, limit, channelType, incomeType, moneyType)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<StakingOrderHistoryData>() {
                    @Override
                    protected void onSuccees(StakingOrderHistoryData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }


    /**
     * staking   挖矿币种转换首页
     *
     * @param moneyType 币种类型
     * @return
     */
    public void getStakingMiningMoneyDrawIndexData(String moneyType) {
        stakingView.ShowProgress();

        apiStores.getStakingMiningMoneyDrawIndexData(moneyType)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<StakingMiningMoneyDrawIndexData>() {
                    @Override
                    protected void onSuccees(StakingMiningMoneyDrawIndexData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getStakingMiningMoneyDrawIndexData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }

    /**
     * staking   挖矿币种转换
     *
     * @param moneyType 币种类型
     * @return
     */
    public void getStakingDrawMiningOrderMoneyData(String payPwd, String money, String moneyType, String intoMoneyType) {
        stakingView.ShowProgress();

        apiStores.getStakingDrawMiningOrderMoneyData(payPwd, money, moneyType, intoMoneyType)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        stakingView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            stakingView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        stakingView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        stakingView.hideProgress();
                        stakingView.onError(e.toString());
                    }
                });
    }


    /**
     * 众筹首页
     *
     * @return
     */
    public void getCorwdIndexData() {
        baseView.ShowProgress();
        apiStores.getCorwdIndexData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CorwdIndexData>() {
                    @Override
                    protected void onSuccees(CorwdIndexData model) throws Exception {
                        baseView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            baseView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        baseView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        baseView.hideProgress();
                        baseView.onError(e.toString());
                    }
                });
    }

    /**
     * 众筹历史
     *
     * @return
     */
    public void getCorwdListData() {
        baseView.ShowProgress();
        apiStores.getCorwdListData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CorwdListData>() {
                    @Override
                    protected void onSuccees(CorwdListData model) throws Exception {
                        baseView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            baseView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        baseView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        baseView.hideProgress();
                        baseView.onError(e.toString());
                    }
                });
    }

    /**
     * 参与众筹
     *
     * @param moneyType wallets 中的id
     * @param price     数量
     * @return
     */
    public void getCorwdAddData(String moneyType, String price) {
        baseView.ShowProgress();
        apiStores.getCorwdAddData(moneyType, price)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CorwdAddData>() {
                    @Override
                    protected void onSuccees(CorwdAddData model) throws Exception {
                        baseView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            baseView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        baseView.getData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        baseView.hideProgress();
                        baseView.onError(e.toString());
                    }
                });
    }

    /**
     * 乐活宝 收益类型
     *
     * @param
     * @param
     */
    public void getChannelTypeData() {
////        userWalletView.ShowProgress();
        apiStores.getChannelTypeData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<ChannelTypeData>() {
                    @Override
                    protected void onSuccees(ChannelTypeData model) throws Exception {
//                        userWalletView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            userWalletView.hideProgress();
                            userWalletView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        userWalletView.getChannelTypeData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
//                        baseView.hideProgress();
                        userWalletView.onError(e.toString());
                    }
                });
    }

    /**
     * 乐活宝 收益类型
     *
     * @param orderId     量化订单id
     * @param limit       条数 100
     * @param page        页数  1
     * @param channelType 收益类型，全部传null值
     * @param moneyType   金额类型
     * @param incomeType  收入支出类型
     */
    public void getLeHuoBaoListData(String orderId, String limit, String page, String channelType,
                                    String moneyType, String incomeType) {
        leHuoBaoView.ShowProgress();
        apiStores.getLeHuoBaoListData(orderId, limit, page, channelType, moneyType, incomeType)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<LeHuoBaoListData>() {
                    @Override
                    protected void onSuccees(LeHuoBaoListData model) throws Exception {
                        leHuoBaoView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            leHuoBaoView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        leHuoBaoView.getLeHuoBaoListData(model);
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        leHuoBaoView.hideProgress();
                        leHuoBaoView.onError(e.toString());
                    }
                });
    }

    /**
     * 区块链钱包充值地址
     *
     * @return
     */
    public void getUserPayAdress() {
        if (baseView != null)
            baseView.ShowProgress();


        apiStores.getUserPayAdress()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<UserPayAdressData>() {
                    @Override
                    protected void onSuccees(UserPayAdressData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                baseView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            baseView.getData(model);
                        }

                        if (userWalletView != null) {
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                userWalletView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            userWalletView.getUserPayAdress(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (userWalletView != null) {
                            userWalletView.onError(e.toString());
                        }
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 获取充值地址
     *
     * @return type
     */
    public void getRechargeAddress(String type) {
        if (baseView != null)
            baseView.ShowProgress();

        apiStores.getRechargeAddress(type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RechargeAddressData>() {
                    @Override
                    protected void onSuccees(RechargeAddressData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                baseView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            baseView.getData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 提现首页
     *
     * @param moneyType
     * @return
     */
    public void getDrawIndexData(String moneyType) {
////        userWalletView.ShowProgress();
        apiStores.getDrawIndexData(moneyType)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<DrawIndexData>() {
                    @Override
                    protected void onSuccees(DrawIndexData model) throws Exception {
                        if (currencyChangeView != null) {
                            currencyChangeView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                currencyChangeView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            currencyChangeView.getDrawIndexData(model);
                        }
                        if (userWalletView != null) {
                            userWalletView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                userWalletView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            userWalletView.getDrawIndexData(model);
                        }
                        if (leHuoBaoView != null) {
                            leHuoBaoView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                leHuoBaoView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            leHuoBaoView.getData(model);
                        }

                        if (stakingView != null) {
                            stakingView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                stakingView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            stakingView.getDrawIndexData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
//                        userWalletView.hideProgress();
                        if (currencyChangeView != null) {
                            currencyChangeView.onError(e.toString());
                            currencyChangeView.hideProgress();
                        }
                        if (userWalletView != null) {
                            userWalletView.onError(e.toString());
                            userWalletView.hideProgress();
                        }
                        if (leHuoBaoView != null) {
                            leHuoBaoView.onError(e.toString());
                            leHuoBaoView.hideProgress();
                        }
                        if (stakingView != null) {
                            stakingView.onError(e.toString());
                            stakingView.hideProgress();
                        }
//                        userWalletView.onError(e.toString());
                    }
                });
    }

    /**
     * 提现
     *
     * @param money      金额
     * @param token      token
     * @param msg        备注
     * @param moneyType  1 ETH 2 G12
     * @param verifyCode 验证码
     * @param payPwd     支付密码
     * @return
     */
    public void getAddDrawData(String money, String token, String msg, String moneyType, String tag, String verifyCode, String payPwd, String googleCode) {
        if (turmOutView != null)
            turmOutView.ShowProgress();

        money = replaceBlank(money);
        token = replaceBlank(token);
        msg = replaceBlank(msg);

        moneyType = replaceBlank(moneyType);
        tag = replaceBlank(tag);
        verifyCode = replaceBlank(verifyCode);
        payPwd = replaceBlank(payPwd);
        googleCode = replaceBlank(googleCode);

        apiStores.getAddDrawData(money, token, msg, moneyType, tag, verifyCode, payPwd, googleCode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<AddDrawData>() {
                    @Override
                    protected void onSuccees(AddDrawData model) throws Exception {
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                turmOutView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            turmOutView.getAddDrawData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            turmOutView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 提现记录
     *
     * @param limit 条数 默认100
     * @param page  页数 默认1
     * @return
     */
    public void getDrawListData(String limit, String page) {
        baseView.ShowProgress();
        apiStores.getDrawListData(limit, page)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<DrawListData>() {
                    @Override
                    protected void onSuccees(DrawListData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                baseView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            baseView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 转账首页
     *
     * @param
     * @return
     */
    public void getTransferIndexData() {
        turmOutView.ShowProgress();
        apiStores.getTransferIndexData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<DrawIndexData>() {
                    @Override
                    protected void onSuccees(DrawIndexData model) throws Exception {
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                turmOutView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            turmOutView.getTransferIndexData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
                        if (turmOutView != null) {
                            turmOutView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 提交转账订单
     *
     * @param money        金额
     * @param intoUserName 转入账号
     * @param moneyType    1 ETH 2 G12 ....
     * @param verifyCode   验证码
     * @param payPwd       支付密码
     * @param googleCode
     * @return
     */
    public void getTransfertransData(String money, String intoUserName, String moneyType, String verifyCode, String payPwd, String googleCode) {
        if (turmOutView != null)
            turmOutView.ShowProgress();

        money = replaceBlank(money);
        intoUserName = replaceBlank(intoUserName);
        moneyType = replaceBlank(moneyType);

        moneyType = replaceBlank(moneyType);
        verifyCode = replaceBlank(verifyCode);
        payPwd = replaceBlank(payPwd);
        googleCode = replaceBlank(googleCode);

        apiStores.getTransfertransData(money, intoUserName, moneyType, verifyCode, payPwd, googleCode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<TransferTransData>() {
                    @Override
                    protected void onSuccees(TransferTransData model) throws Exception {
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                turmOutView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            turmOutView.getTransfertransData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            turmOutView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 检测登录名是否存在
     *
     * @param loginName 用户名
     * @return
     */
    public void getcheckLoginNameData(String loginName) {
        if (turmOutView != null)
            turmOutView.ShowProgress();

        loginName = replaceBlank(loginName);


        apiStores.getcheckLoginNameData(loginName)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                turmOutView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            turmOutView.getcheckLoginNameData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (turmOutView != null) {
                            turmOutView.hideProgress();
                            turmOutView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 获取公告/平台消息
     *
     * @param msgType
     * @return
     */
    public void getMessageData(String msgType) {
        baseView.ShowProgress();
        apiStores.getMessageData(msgType)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<MessageData>() {
                    @Override
                    protected void onSuccees(MessageData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                baseView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            baseView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 申请/升级Vip
     *
     * @param type
     * @return
     */
    public void getAddUpVipData(String type, String acMoney, String froMoney, String payPwd) {
        vipApplyView.ShowProgress();

        acMoney = replaceBlank(acMoney);
        froMoney = replaceBlank(froMoney);
        payPwd = replaceBlank(payPwd);

        apiStores.getAddUpVipData(type, acMoney, froMoney, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<AddUpCloseVipData>() {
                    @Override
                    protected void onSuccees(AddUpCloseVipData model) throws Exception {
                        if (vipApplyView != null) {
                            vipApplyView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                vipApplyView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            vipApplyView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (vipApplyView != null) {
                            vipApplyView.hideProgress();
                            vipApplyView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 解除VIP
     *
     * @param
     * @param
     */
    public void getStopVipData(String payPwd) {
        vipApplyView.ShowProgress();
        apiStores.getStopVipData(payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<AddUpCloseVipData>() {
                    @Override
                    protected void onSuccees(AddUpCloseVipData model) throws Exception {
                        if (vipApplyView != null) {
                            vipApplyView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                vipApplyView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            vipApplyView.getStopVipData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (vipApplyView != null) {
                            vipApplyView.hideProgress();
                            vipApplyView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * vip订单历史
     *
     * @param limit 条数 100
     * @param page  页数  1
     * @return
     */
    public void getVipOrderListData(String limit, String page) {
        vipApplyView.ShowProgress();
        apiStores.getVipOrderListData(limit, page)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<VipOrderListData>() {
                    @Override
                    protected void onSuccees(VipOrderListData model) throws Exception {
                        if (vipApplyView != null) {
                            vipApplyView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                vipApplyView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            vipApplyView.getVipOrderListData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (vipApplyView != null) {
                            vipApplyView.hideProgress();
                            vipApplyView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 获取当期vip订单信息
     *
     * @param
     * @param
     */
    public void getCurrentOrderData() {
        vipApplyView.ShowProgress();
        apiStores.getCurrentOrderData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CurrentOrderData>() {
                    @Override
                    protected void onSuccees(CurrentOrderData model) throws Exception {
                        if (vipApplyView != null) {
                            vipApplyView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                vipApplyView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            vipApplyView.getCurrentOrderData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (vipApplyView != null) {
                            vipApplyView.hideProgress();
                            vipApplyView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 获取G12
     *
     * @return
     */
    public void getG12CanData() {
        quantitativeOrderOpenAddView.ShowProgress();
        apiStores.getG12CanData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<G12CanData>() {
                    @Override
                    protected void onSuccees(G12CanData model) throws Exception {
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrderOpenAddView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrderOpenAddView.getG12CanData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            quantitativeOrderOpenAddView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 量化2.0 订单详情
     */
    public void getLH2OrderDetailsData() {
        quantitativeOrder2View.ShowProgress();
        apiStores.getLH2OrderDetailsData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<LH2OrderDetailsData>() {
                    @Override
                    protected void onSuccees(LH2OrderDetailsData model) throws Exception {
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrder2View.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrder2View.getLH2OrderOrderDetails(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            quantitativeOrder2View.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 量化2.0 订单收益list
     */
    public void getLH2OrderCaifuListData(String limit, String page) {
        quantitativeOrder2View.ShowProgress();
        apiStores.getLH2OrderCaifuListData(limit, page)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<QuantitativeAShouyiListData>() {
                    @Override
                    protected void onSuccees(QuantitativeAShouyiListData model) throws Exception {
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrder2View.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrder2View.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            quantitativeOrder2View.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 量化2.0  订单添加追加的显示
     *
     * @return
     */
    public void getLH2OrderNoOrderShowData(String type) {
        quantitativeOrder2View.ShowProgress();
        apiStores.getLH2OrderNoOrderShowData(type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<QuantitativeBaseChangeData>() {
                    @Override
                    protected void onSuccees(QuantitativeBaseChangeData model) throws Exception {
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrder2View.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrder2View.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            quantitativeOrder2View.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 量化2.0  部分关闭显示
     *
     * @return
     */
    public void getLH2OrderPartOrderShowData() {
        quantitativeOrder2View.ShowProgress();
        apiStores.getLH2OrderPartOrderShowData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<QuantitativeBaseChangeData>() {
                    @Override
                    protected void onSuccees(QuantitativeBaseChangeData model) throws Exception {
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrder2View.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrder2View.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            quantitativeOrder2View.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 20all关闭 量化订单
     *
     * @param ordersn
     * @param
     * @return
     */
    public void getLH2OrderCloseOrderData(String ordersn, String payPwd) {
        quantitativeOrder2View.ShowProgress();
        apiStores.getLH2OrderCloseOrderData(ordersn, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<AddAppendOrderData>() {
                    @Override
                    protected void onSuccees(AddAppendOrderData model) throws Exception {
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrder2View.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrder2View.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            quantitativeOrder2View.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 20 部分关闭 量化订单
     *
     * @param ordersn
     * @param
     * @return
     */
    public void getLH2OrderCloseOrderPartData(String ordersn, String moneyType, String money, String hmoneyType,
                                              String hmoney, String payPwd) {
        quantitativeOrder2View.ShowProgress();

        ordersn = replaceBlank(ordersn);
        moneyType = replaceBlank(moneyType);
        money = replaceBlank(money);
        payPwd = replaceBlank(payPwd);

        apiStores.getLH2OrderCloseOrderPartData(ordersn, moneyType, money, hmoneyType, hmoney, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<LH2OrderDetailsData>() {
                    @Override
                    protected void onSuccees(LH2OrderDetailsData model) throws Exception {
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrder2View.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrder2View.getLH2OrderOrderDetails(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            quantitativeOrder2View.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 30添加量化订单  /api/LHOrder/addLhOrder
     *
     * @param money      ETH 数量
     * @param moneyType  MIOnum 数量
     * @param hmoney     币种类型 ETH=1
     * @param hmoneyType 币种类型 ETH=1
     * @return
     */
    public void getAdd30LhOrderData(String money, String moneyType, String hmoney, String hmoneyType, String payPwd) {
        quantitativeOrder2View.ShowProgress();

        money = replaceBlank(money);
        hmoney = replaceBlank(hmoney);
        hmoneyType = replaceBlank(hmoneyType);
        payPwd = replaceBlank(payPwd);

        apiStores.getAdd30LhOrderData(money, moneyType, hmoney, hmoneyType, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<BuyHMioAddData>() {
                    @Override
                    protected void onSuccees(BuyHMioAddData model) throws Exception {
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrder2View.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrder2View.getLH2OrderOrderDetails(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            quantitativeOrder2View.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 30追加 量化订单  /api/LHOrder/appendOrder
     *
     * @param money     不带H的币种
     * @param hmoney    MIOnum 数量
     * @param moneyType 币种类型 ETH=1
     * @return
     */
    public void getAppend30OrderData(String money, String hmoney, String moneyType, String hmoneyType, String payPwd) {
        quantitativeOrder2View.ShowProgress();

        money = replaceBlank(money);
        hmoney = replaceBlank(hmoney);
        moneyType = replaceBlank(moneyType);
        payPwd = replaceBlank(payPwd);

        apiStores.getAppend30OrderData(money, hmoney, moneyType, hmoneyType, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<LH2OrderDetailsData>() {
                    @Override
                    protected void onSuccees(LH2OrderDetailsData model) throws Exception {
                        if (quantitativeOrder2View != null) {
                            quantitativeOrder2View.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrder2View.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrder2View.getLH2OrderOrderDetails(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            quantitativeOrderOpenAddView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 会员量化订单列表  /api/LHOrder/userListLH
     *
     * @param page  页数  1
     * @param limit 条数 100
     * @return
     */
    public void getUserListLHData(String limit, String page) {
        quantitativeOrderOpenAddView.ShowProgress();
        apiStores.getUserListLHData(limit, page)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<UserListLHData>() {
                    @Override
                    protected void onSuccees(UserListLHData model) throws Exception {
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrderOpenAddView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrderOpenAddView.getUserListLHData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            quantitativeOrderOpenAddView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 点击添加量化订单显示  /api/LHOrder/showUserXingji
     *
     * @return
     */
    public void getShowUserXingjiData() {
        quantitativeOrderOpenAddView.ShowProgress();
        apiStores.getShowUserXingjiData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<ShowUserXingjiData>() {
                    @Override
                    protected void onSuccees(ShowUserXingjiData model) throws Exception {
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrderOpenAddView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrderOpenAddView.getShowUserXingjiData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            quantitativeOrderOpenAddView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 添加量化订单  /api/LHOrder/addLhOrder
     *
     * @param xingji    星级
     * @param ETHnum    ETH 数量
     * @param MIOnum    MIOnum 数量
     * @param ordertype 币种类型 ETH=1
     * @return
     */
    public void getAddLhOrderData(String xingji, String ETHnum, String MIOnum, String ordertype, String payPwd) {
        quantitativeOrderOpenAddView.ShowProgress();

        ETHnum = replaceBlank(ETHnum);
        MIOnum = replaceBlank(MIOnum);
        ordertype = replaceBlank(ordertype);
        payPwd = replaceBlank(payPwd);

        apiStores.getAddLhOrderData(xingji, ETHnum, MIOnum, ordertype, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<AddAppendOrderData>() {
                    @Override
                    protected void onSuccees(AddAppendOrderData model) throws Exception {
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrderOpenAddView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrderOpenAddView.getAddLhOrderData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            quantitativeOrderOpenAddView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 追加 量化订单  /api/LHOrder/appendOrder
     *
     * @param xingji    星级
     * @param ETHnum    ETH 数量
     * @param MIOnum    MIOnum 数量
     * @param ordertype 币种类型 ETH=1
     * @return
     */
    public void getAppendOrderData(String xingji, String ETHnum, String MIOnum, String ordertype, String payPwd) {
        quantitativeOrderOpenAddView.ShowProgress();

        ETHnum = replaceBlank(ETHnum);
        MIOnum = replaceBlank(MIOnum);
        ordertype = replaceBlank(ordertype);
        payPwd = replaceBlank(payPwd);

        apiStores.getAppendOrderData(xingji, ETHnum, MIOnum, ordertype, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<AddAppendOrderData>() {
                    @Override
                    protected void onSuccees(AddAppendOrderData model) throws Exception {
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrderOpenAddView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrderOpenAddView.getAppendOrderData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            quantitativeOrderOpenAddView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 追加显示 量化订单  /api/LHOrder/zhuijiashow
     *
     * @param ordersn
     * @param
     * @return
     */
    public void getZhuijiashowData(String ordersn) {
        quantitativeOrderOpenAddView.ShowProgress();
        apiStores.getZhuijiashowData(ordersn)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<ZhuijiashowData>() {
                    @Override
                    protected void onSuccees(ZhuijiashowData model) throws Exception {
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrderOpenAddView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrderOpenAddView.getZhuijiashowData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            quantitativeOrderOpenAddView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 关闭 量化订单  /api/LHOrder/closeOrder
     *
     * @param ordersn
     * @param
     * @return
     */
    public void getCloseOrderData(String ordersn, String payPwd) {
        quantitativeOrderOpenAddView.ShowProgress();
        apiStores.getCloseOrderData(ordersn, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<AddAppendOrderData>() {
                    @Override
                    protected void onSuccees(AddAppendOrderData model) throws Exception {
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrderOpenAddView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrderOpenAddView.getCloseOrderData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            quantitativeOrderOpenAddView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 关闭 量化订单  /api/LHOrder/closeOrder
     *
     * @param ordersn
     * @param
     * @return
     */
    public void getcloseOrderPartData(String ordersn, String moneyType, String money, String payPwd) {
        quantitativeOrderOpenAddView.ShowProgress();
        apiStores.getcloseOrderPartData(ordersn, moneyType, money, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<AddAppendOrderData>() {
                    @Override
                    protected void onSuccees(AddAppendOrderData model) throws Exception {
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                quantitativeOrderOpenAddView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            quantitativeOrderOpenAddView.getCloseOrderData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (quantitativeOrderOpenAddView != null) {
                            quantitativeOrderOpenAddView.hideProgress();
                            quantitativeOrderOpenAddView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 币种转换首页  币种转换
     *
     * @param
     * @param
     * @return
     */
    public void getCurrencyChangeIndexData() {
        currencyChangeView.ShowProgress();
        apiStores.getCurrencyChangeIndexData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CurrencyChangeIndexData>() {
                    @Override
                    protected void onSuccees(CurrencyChangeIndexData model) throws Exception {
                        if (currencyChangeView != null) {
                            currencyChangeView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                currencyChangeView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            currencyChangeView.getCurrencyChangeIndexData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (currencyChangeView != null) {
                            currencyChangeView.hideProgress();
                            currencyChangeView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 币种转换
     *
     * @param outMoney     double 需要转换的金额
     * @param outMoneyType 转出币种 1 ETH 2 G12
     * @param inMoneyType  需要转入的币种
     * @return
     */
    public void getCurrencyChangeData(String outMoney, String outMoneyType, String inMoneyType, String payPwd) {
        currencyChangeView.ShowProgress();
        apiStores.getCurrencyChangeData(outMoney, outMoneyType, inMoneyType, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CurrencyChangeData>() {
                    @Override
                    protected void onSuccees(CurrencyChangeData model) throws Exception {
                        if (currencyChangeView != null) {
                            currencyChangeView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                currencyChangeView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            currencyChangeView.getCurrencyChangeData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (currencyChangeView != null) {
                            currencyChangeView.hideProgress();
                            currencyChangeView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 优兑 额度首页
     *
     * @param
     * @param
     * @return
     */
    public void getExchangeQuotaWalletIndexData() {
        exchangeQuotaView.ShowProgress();
        apiStores.getExchangeQuotaWalletIndexData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<QuotaWalletIndexData>() {
                    @Override
                    protected void onSuccees(QuotaWalletIndexData model) throws Exception {
                        if (exchangeQuotaView != null) {
//                            exchangeQuotaView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                exchangeQuotaView.hideProgress();
                                exchangeQuotaView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            exchangeQuotaView.getData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (exchangeQuotaView != null) {
                            exchangeQuotaView.hideProgress();
                            exchangeQuotaView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 优兑 额度兑换记录
     *
     * @param
     * @param
     * @return
     */
    public void getQuotaPageData() {
//        exchangeQuotaView.ShowProgress();
        apiStores.getQuotaPageData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<QuotaPageData>() {
                    @Override
                    protected void onSuccees(QuotaPageData model) throws Exception {
                        if (exchangeQuotaView != null) {
                            exchangeQuotaView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                exchangeQuotaView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            exchangeQuotaView.getQuotaPage(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (exchangeQuotaView != null) {
                            exchangeQuotaView.hideProgress();
                            exchangeQuotaView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 币种转换首页  优兑
     *
     * @param outType  需要兑出的币种  = 2
     * @param intoType 需要兑换的币种  = 12
     * @return
     */
    public void getCurrencyChangeIndexData(String outType, String intoType) {
        currencyChangeView.ShowProgress();
        apiStores.getCurrencyChangeIndexData(outType, intoType)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CurrencyChangeIndexData>() {
                    @Override
                    protected void onSuccees(CurrencyChangeIndexData model) throws Exception {
                        if (currencyChangeView != null) {
                            currencyChangeView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                currencyChangeView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            currencyChangeView.getCurrencyChangeIndexData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (currencyChangeView != null) {
                            currencyChangeView.hideProgress();
                            currencyChangeView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 订单列表 币种转换
     *
     * @param limit 条数 100
     * @param page  页数  1
     * @return
     */
    public void getCurrencyChangeListData(String limit, String page) {
        currencyChangeView.ShowProgress();
        apiStores.getCurrencyChangeListData(limit, page)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CurrencyChangeListData>() {
                    @Override
                    protected void onSuccees(CurrencyChangeListData model) throws Exception {
                        if (currencyChangeView != null) {
                            currencyChangeView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                currencyChangeView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            currencyChangeView.getCurrencyChangeListData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (currencyChangeView != null) {
                            currencyChangeView.hideProgress();
                            currencyChangeView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 获取超级彩蛋_数据
     *
     * @param
     * @param
     */
    public void getSuperColorEggData() {
        superColorEggView.ShowProgress();
        apiStores.getSuperColorEggData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<SuperColorEggData>() {
                    @Override
                    protected void onSuccees(SuperColorEggData model) throws Exception {
                        if (superColorEggView != null) {
                            superColorEggView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                superColorEggView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            superColorEggView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (superColorEggView != null) {
                            superColorEggView.hideProgress();
                            superColorEggView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 预约订单列表
     *
     * @param page  页数
     * @param limit 条数
     * @return
     */
    public void getSubscribeOrderList(String limit, String page) {
        subscribleOrderEggView.ShowProgress();
        apiStores.getSubscribeOrderList(page, limit)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<SubscribeOrderListData>() {
                    @Override
                    protected void onSuccees(SubscribeOrderListData model) throws Exception {
                        if (subscribleOrderEggView != null) {
                            subscribleOrderEggView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                subscribleOrderEggView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            subscribleOrderEggView.getSubscribeOrderList(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (subscribleOrderEggView != null) {
                            subscribleOrderEggView.hideProgress();
                            subscribleOrderEggView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 添加预约订单
     *
     * @param eggProductId
     * @param time
     * @return
     */
    public void getAddSubscribeOrder(String eggProductId, String time, String payPwd, String subTimestamp) {
        subscribleOrderEggView.ShowProgress();
        apiStores.getAddSubscribeOrder(eggProductId, time, payPwd, subTimestamp)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<AddSubscribeOrderData>() {
                    @Override
                    protected void onSuccees(AddSubscribeOrderData model) throws Exception {
                        if (subscribleOrderEggView != null) {
                            subscribleOrderEggView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                subscribleOrderEggView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            subscribleOrderEggView.getAddSubscribeOrder(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (subscribleOrderEggView != null) {
                            subscribleOrderEggView.hideProgress();
                            subscribleOrderEggView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 预约订单删除
     *
     * @param id
     * @param payPwd
     * @return
     */
    public void getCancelSubScribeOrder(String id, String payPwd) {
        subscribleOrderEggView.ShowProgress();
        apiStores.getCancelSubScribeOrder(id, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CancelSubScribeOrderData>() {
                    @Override
                    protected void onSuccees(CancelSubScribeOrderData model) throws Exception {
                        if (subscribleOrderEggView != null) {
                            subscribleOrderEggView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                subscribleOrderEggView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            subscribleOrderEggView.getCancelSubScribeOrder(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (subscribleOrderEggView != null) {
                            subscribleOrderEggView.hideProgress();
                            subscribleOrderEggView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 购买超蛋
     *
     * @param goodsId 购买的产品id
     * @return
     */
    public void getEggAddData(String goodsId, String payPwd) {
        superColorEggView.ShowProgress();
        apiStores.getEggAddData(goodsId, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (superColorEggView != null) {
                            superColorEggView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                superColorEggView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            superColorEggView.getEggAddData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (superColorEggView != null) {
                            superColorEggView.hideProgress();
                            superColorEggView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 彩蛋排行榜
     *
     * @param page  页数
     * @param limit 条数
     * @return
     */
    public void getEggRankingData(String limit, String page) {
        superColorEggView.ShowProgress();
        apiStores.getEggRankingData(page, limit)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<EggRankingData>() {
                    @Override
                    protected void onSuccees(EggRankingData model) throws Exception {
                        if (superColorEggView != null) {
                            superColorEggView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                superColorEggView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            superColorEggView.getEggRankingData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (superColorEggView != null) {
                            superColorEggView.hideProgress();
                            superColorEggView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 彩蛋钱包记录
     *
     * @param page      页数
     * @param limit     条数
     * @param moneyType 我的彩蛋  ：moneyType : 1 /    我的SMIO ：moneyType: 2  /  我的smio激励  ：moneyType : 2 channelType :3
     * @return
     */
    public void getEggWalletLogData(String limit, String page, String moneyType) {
        superColorEggView.ShowProgress();
        apiStores.getEggWalletLogData(page, limit, moneyType)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<EggWalletLogData>() {
                    @Override
                    protected void onSuccees(EggWalletLogData model) throws Exception {
                        if (superColorEggView != null) {
                            superColorEggView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                superColorEggView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            superColorEggView.getEggWalletLogData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (superColorEggView != null) {
                            superColorEggView.hideProgress();
                            superColorEggView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 激励记录
     *
     * @param page      页数
     * @param limit     条数
     * @param moneyType 1 彩蛋激励 2 合伙人收益
     * @return
     */
    public void getEggExcitationData(String limit, String page, String moneyType) {
        superColorEggView.ShowProgress();
        apiStores.getEggExcitationData(page, limit, moneyType)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<EggWalletLogData>() {
                    @Override
                    protected void onSuccees(EggWalletLogData model) throws Exception {
                        if (superColorEggView != null) {
                            superColorEggView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                superColorEggView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            superColorEggView.getEggWalletLogData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (superColorEggView != null) {
                            superColorEggView.hideProgress();
                            superColorEggView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 合伙人首页_数据
     *
     * @return
     */
    public void getEggPartnerIndexData() {
//        eggPartnerView.ShowProgress();
        apiStores.getEggPartnerIndexData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<EggPartnerIndexData>() {
                    @Override
                    protected void onSuccees(EggPartnerIndexData model) throws Exception {
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                eggPartnerView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            eggPartnerView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            eggPartnerView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 购买合伙人
     *
     * @param goodsId 购买的产品id
     * @return
     */
    public void getEggPartnerAddData(String goodsId) {
        eggPartnerView.ShowProgress();
        apiStores.getEggPartnerAddData(goodsId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                eggPartnerView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            eggPartnerView.getEggPartnerAddData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            eggPartnerView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * mioex首页_数据
     *
     * @return
     */
    public void getMioOperatorIndexData() {
//        eggPartnerView.ShowProgress();
        apiStores.getMioOperatorIndexData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<EggPartnerIndexData>() {
                    @Override
                    protected void onSuccees(EggPartnerIndexData model) throws Exception {
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                eggPartnerView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            eggPartnerView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            eggPartnerView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 购买mioex
     *
     * @param productId 购买的产品id
     * @return
     */
    public void getMioOperatorAddData(String productId) {
        eggPartnerView.ShowProgress();
        apiStores.getMioOperatorAddData(productId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<MioOperatorAddOrderData>() {
                    @Override
                    protected void onSuccees(MioOperatorAddOrderData model) throws Exception {
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                eggPartnerView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            eggPartnerView.getMioOperatorAddOrderData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            eggPartnerView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * mioopr首页_数据
     *
     * @return
     */
    public void getMioOperatorOprIndexData() {
//        eggPartnerView.ShowProgress();
        apiStores.getMioOperatorOprIndexData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<EggPartnerIndexData>() {
                    @Override
                    protected void onSuccees(EggPartnerIndexData model) throws Exception {
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                eggPartnerView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            eggPartnerView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            eggPartnerView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 购买mioopr
     *
     * @param productId 购买的产品id
     * @return
     */
    public void getMioOperatorOprAddData(String productId) {
        eggPartnerView.ShowProgress();
        apiStores.getMioOperatorOprAddData(productId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<MioOperatorAddOrderData>() {
                    @Override
                    protected void onSuccees(MioOperatorAddOrderData model) throws Exception {
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                eggPartnerView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            eggPartnerView.getMioOperatorAddOrderData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            eggPartnerView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 购买_订单付款
     *
     * @param orderSn 购买的产品id
     * @return
     */
    public void getMioOperatorPayOrderData(String orderSn, String payPwd) {
        eggPartnerView.ShowProgress();
        apiStores.getMioOperatorPayOrderData(orderSn, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                eggPartnerView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            eggPartnerView.getEggPartnerAddData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (eggPartnerView != null) {
                            eggPartnerView.hideProgress();
                            eggPartnerView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 糖果 糖果余额
     *
     * @return
     */
    public void getActiveMio() {
        candyView.ShowProgress();
        apiStores.getActiveMio()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<ActiveMioData>() {
                    @Override
                    protected void onSuccees(ActiveMioData model) throws Exception {
                        if (candyView != null) {
                            candyView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                candyView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            candyView.getActiveMio(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (candyView != null) {
                            candyView.hideProgress();
                            candyView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 糖果 添加糖果
     *
     * @param jine     红包金额
     * @param num      红包个数
     * @param thistype 1随机2固定
     * @return
     */
    public void getSubmitHongBaoData(String jine, String num, String thistype, String moneyType, String payPwd) {
        candyView.ShowProgress();
        apiStores.getSubmitHongBaoData(jine, num, thistype, moneyType, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (candyView != null) {
                            candyView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                candyView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            candyView.getSubmitHongBaoData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (candyView != null) {
                            candyView.hideProgress();
                            candyView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 糖果 记录
     *
     * @param
     * @return
     */
    public void getCandyOrderList() {
        baseView.ShowProgress();
        apiStores.getCandyOrderList()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CandyOrderListData>() {
                    @Override
                    protected void onSuccees(CandyOrderListData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                baseView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            baseView.getData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 糖果 记录item详情
     *
     * @param oderid
     * @return
     */
    public void getCandyOrderDetil(String id) {
        baseView.ShowProgress();
        apiStores.getCandyOrderDetil(id)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CandyOrderDetilData>() {
                    @Override
                    protected void onSuccees(CandyOrderDetilData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                baseView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            baseView.getData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 糖果 退回糖果
     *
     * @param id
     * @return
     */
    public void getCandyReturnData(String id) {
        baseView.ShowProgress();
        apiStores.getCandyReturnData(id)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CandyOrderDetilData>() {
                    @Override
                    protected void onSuccees(CandyOrderDetilData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                baseView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            baseView.getData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 糖果 扫一扫领取糖果
     *
     * @return
     */
    public void getDrawCandyData(String CandyUrl, String mycode) {
        currencyChangeView.ShowProgress();
        apiStores.getDrawCandyData(CandyUrl, mycode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (currencyChangeView != null) {
                            currencyChangeView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                currencyChangeView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            currencyChangeView.getDrawCandyData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (currencyChangeView != null) {
                            currencyChangeView.hideProgress();
                            currencyChangeView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 获取币种信息
     *
     * @param type 需要获取的币种信息ID
     * @return
     */
    public void getCoinDetailData(String type) {
        apiStores.getCoinDetailData(type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<CoinDetailData>() {
                    @Override
                    protected void onSuccees(CoinDetailData model) throws Exception {

                        if (userWalletView != null) {
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                userWalletView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            userWalletView.getCoinDetailData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (userWalletView != null) {
                            userWalletView.hideProgress();
                            userWalletView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 挖矿币种钱包首页
     *
     * @param moneyType 4mbtc
     * @return
     */
    public void getMiningWalletTypeIndexData(String moneyType) {
//        stakingView.ShowProgress();
        apiStores.getMiningWalletTypeIndexData(moneyType)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<MiningWalletTypeIndexData>() {
                    @Override
                    protected void onSuccees(MiningWalletTypeIndexData model) throws Exception {
                        if (stakingView != null) {
                            stakingView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                stakingView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            stakingView.getMiningWalletTypeIndexData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (stakingView != null) {
                            stakingView.hideProgress();
                            stakingView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * mioEx 钱包首页
     *
     * @return
     */
    public void getMioOperatorMioExIndexData() {
//        stakingView.ShowProgress();
        apiStores.getMioOperatorMioExIndexData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<MiningWalletTypeIndexData>() {
                    @Override
                    protected void onSuccees(MiningWalletTypeIndexData model) throws Exception {
                        if (leHuoBaoView != null) {
                            leHuoBaoView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                leHuoBaoView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            leHuoBaoView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (leHuoBaoView != null) {
                            leHuoBaoView.hideProgress();
                            leHuoBaoView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * HMIO映射数据
     *
     * @return
     */
    public void getHMioMapData() {
        buyHMioView.ShowProgress();
        apiStores.getHMioMapData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<HMioMapData>() {
                    @Override
                    protected void onSuccees(HMioMapData model) throws Exception {
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                buyHMioView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            buyHMioView.getData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            buyHMioView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * HMIO 添加兑换订单
     *
     * @param address 页数  1
     * @param payPwd  条数 100
     * @return
     */
    public void getHmioBindData(String address, String payPwd) {
        buyHMioView.ShowProgress();
        apiStores.getHmioBindData(address, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<BuyHMioAddData>() {
                    @Override
                    protected void onSuccees(BuyHMioAddData model) throws Exception {
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                buyHMioView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            buyHMioView.getBuyHMioAddOrder(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            buyHMioView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * HMIO 兑换首页
     *
     * @return
     */
    public void getHMioIndexData() {
        buyHMioView.ShowProgress();
        apiStores.getHMioIndexData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<BuyHMioTransIndexData>() {
                    @Override
                    protected void onSuccees(BuyHMioTransIndexData model) throws Exception {
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                buyHMioView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            buyHMioView.getData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            buyHMioView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * HMIO 开始兑换首页
     *
     * @return
     */
    public void getHMioTransIndexData() {
        buyHMioView.ShowProgress();
        apiStores.getHMioTransIndexData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<BuyHMioTransIndexData>() {
                    @Override
                    protected void onSuccees(BuyHMioTransIndexData model) throws Exception {
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                buyHMioView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            buyHMioView.getData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            buyHMioView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * HMIO 添加兑换订单
     *
     * @param dollar    页数  1
     * @param moneyType 条数 100
     * @param payPwd    条数 100
     * @return
     */
    public void getHMioAddOrderData(String dollar, String moneyType, String payPwd) {
        buyHMioView.ShowProgress();
        apiStores.getHMioAddOrderData(dollar, moneyType, payPwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<BuyHMioAddData>() {
                    @Override
                    protected void onSuccees(BuyHMioAddData model) throws Exception {
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                buyHMioView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            buyHMioView.getBuyHMioAddOrder(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            buyHMioView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * HMIO 兑换记录
     *
     * @param page  页数  1
     * @param limit 条数 100
     * @return
     */
    public void getHMioOrderLogData(String limit, String page) {
        buyHMioView.ShowProgress();
        apiStores.getHMioOrderLogData(limit, page)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<BuyHMioOrderLogData>() {
                    @Override
                    protected void onSuccees(BuyHMioOrderLogData model) throws Exception {
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                buyHMioView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            buyHMioView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (buyHMioView != null) {
                            buyHMioView.hideProgress();
                            buyHMioView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 设置语言
     *
     * @param lang 语言类型 中文 ：zh_CN 英文 ：en_US
     * @return
     */
    public void setLangType(String type) {
        baseView.ShowProgress();
        apiStores.setLangType(type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                baseView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            baseView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 好友推广邀请数据
     *
     * @return
     */
    public void getInviteFriendsData() {
        baseView.ShowProgress();
        apiStores.getInviteFriendsData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<InviteFriendsData>() {
                    @Override
                    protected void onSuccees(InviteFriendsData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                baseView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            baseView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 获取国家地区数据
     *
     * @return
     */
    public void getCountryData() {
        fundArealistView.ShowProgress();
        apiStores.getCountryData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<FundArealistResponse>() {
                    @Override
                    protected void onSuccees(FundArealistResponse model) throws Exception {
                        fundArealistView.hideProgress();
                        if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                            fundArealistView.jumpToLoginAct(model.getStatus());
                            return;
                        }
                        fundArealistView.getCountry(model);
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        fundArealistView.hideProgress();
                        fundArealistView.onError(e.toString());
                    }
                });
    }

    /**
     * 活动首页_数据
     *
     * @return
     */
    public void getActivityIndexData() {
        activityView.ShowProgress();
        apiStores.getActivityIndexData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<ActivityIndexData>() {
                    @Override
                    protected void onSuccees(ActivityIndexData model) throws Exception {
                        if (activityView != null) {
                            activityView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                activityView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            activityView.getActivityIndexData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (activityView != null) {
                            activityView.hideProgress();
                            activityView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 活动详情
     *
     * @param id 活动id
     * @return
     */
    public void getActivityDetailData(String id) {
        activityView.ShowProgress();
        apiStores.getActivityDetailData(id)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<ActivityDetailData>() {
                    @Override
                    protected void onSuccees(ActivityDetailData model) throws Exception {
                        if (activityView != null) {
                            activityView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                activityView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            activityView.getActivityDetailData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (activityView != null) {
                            activityView.hideProgress();
                            activityView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 订单详情
     *
     * @param id 订单id
     * @return
     */
    public void getActivityUserOrderDetailData(String id) {
        activityView.ShowProgress();
        apiStores.getActivityUserOrderDetailData(id)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<ActivityDetailData>() {
                    @Override
                    protected void onSuccees(ActivityDetailData model) throws Exception {
                        if (activityView != null) {
                            activityView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                activityView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            activityView.getActivityDetailData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (activityView != null) {
                            activityView.hideProgress();
                            activityView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 参与活动
     *
     * @param orderId            活动id
     * @param msg                备注信息
     * @param userRealName       姓名
     * @param userRealNameEn     英文姓名
     * @param phoneAreaCode      手机区号
     * @param userPhone          手机号
     * @param nationality        国籍
     * @param userSex            性别
     * @param userBirthPlace     出生地
     * @param userBirthTime      出生时间
     * @param passportNo         护照号
     * @param passportCreateTime 护照签发时间
     * @param passportEndTime    护照到期时间
     * @param passportAddress    签发地
     * @return
     */
    public void getActivityJoinData(String orderId, String msg, String userRealName, String userRealNameEn, String phoneAreaCode,
                                    String userPhone, String nationality, String userSex, String userBirthPlace, String userBirthTime,
                                    String passportNo, String passportCreateTime, String passportEndTime, String passportAddress, String city,
                                    String productId, String userRealSurname, String userRealSurnameEn) {
        activityView.ShowProgress();
        apiStores.getActivityJoinData(orderId, msg, userRealName, userRealNameEn, phoneAreaCode,
                userPhone, nationality, userSex, userBirthPlace, userBirthTime,
                passportNo, passportCreateTime, passportEndTime, passportAddress, city, productId, userRealSurname, userRealSurnameEn)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (activityView != null) {
                            activityView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                activityView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            activityView.getActivityJoinData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (activityView != null) {
                            activityView.hideProgress();
                            activityView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 支付--参与活动支付
     *
     * @param id     需要支付的订单id
     * @param payPwd
     * @return
     */
    public void getActivityPayOrderData(String id, String payPwd, String verifyCode, String googleCode) {
        activityView.ShowProgress();
        apiStores.getActivityPayOrderData(id, payPwd, verifyCode, googleCode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (activityView != null) {
                            activityView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                activityView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            activityView.getActivityPayOrderData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (activityView != null) {
                            activityView.hideProgress();
                            activityView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 记录--参与活动 记录
     *
     * @param limit 条数
     * @param page  页数
     * @return
     */
    public void getActivityJoinListData(String limit, String page) {
        activityView.ShowProgress();
        apiStores.getActivityJoinListData(limit, page)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<ActivityJoinListData>() {
                    @Override
                    protected void onSuccees(ActivityJoinListData model) throws Exception {
                        if (activityView != null) {
                            activityView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                activityView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            activityView.getActivityJoinListData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (activityView != null) {
                            activityView.hideProgress();
                            activityView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 取消订单--活动
     *
     * @param id 需要取消的订单id
     * @return
     */
    public void getActivitycancelOrderData(String id) {
        activityView.ShowProgress();
        apiStores.getActivitycancelOrderData(id)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<RegisterData>() {
                    @Override
                    protected void onSuccees(RegisterData model) throws Exception {
                        if (activityView != null) {
                            activityView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                activityView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            activityView.getActivityPayOrderData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (activityView != null) {
                            activityView.hideProgress();
                            activityView.onError(e.toString());
                        }
                    }
                });
    }


    /**
     * 账单记录详情
     *
     * @param logId 订单id
     * @return
     */
    public void getWalletLogDetailData(String logId) {
        baseView.ShowProgress();
        apiStores.getWalletLogDetailData(logId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<WalletLogDetaiData>() {
                    @Override
                    protected void onSuccees(WalletLogDetaiData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                baseView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            baseView.getData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 提现订单详情
     *
     * @param id 订单id
     * @return
     */
    public void getDrawLogDetailData(String id) {
        baseView.ShowProgress();
        apiStores.getDrawLogDetailData(id)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<WalletLogDetaiData>() {
                    @Override
                    protected void onSuccees(WalletLogDetaiData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            if (model != null && (model.getStatus() == 3 || model.getStatus() == 4 || model.getStatus() == 666)) {
                                baseView.jumpToLoginAct(model.getStatus());
                                return;
                            }
                            baseView.getData(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 获取版本更新
     *
     * @param apptype
     * @return
     */
    public void getUpdateData(String apptype) {
////        baseView.ShowProgress();

        apiStores.getUpdateData(apptype)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<UpdateData>() {
                    @Override
                    protected void onSuccees(UpdateData model) throws Exception {
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.getData(model);
                        }
                        if (mainView != null) {
                            mainView.hideProgress();
                            mainView.getData(model);
                        }
//                        if(t.isSuccess()){
//                            view.setContent("Hello---->"+t.getData().getName());
//                        }else {
//                            view.setContent("----->"+t.getMessage());
//                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (baseView != null) {
                            baseView.hideProgress();
                            baseView.onError(e.toString());
                        }
                        if (mainView != null) {
                            mainView.hideProgress();
                            mainView.onError(e.toString());
                        }
                    }
                });
    }

    /**
     * 获取版本更新
     *
     * @param apptype
     * @return
     */
    public void getUpdateData1(String apptype) {
////        baseView.ShowProgress();

        apiStores.getUpdateData(apptype)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<UpdateData>() {
                    @Override
                    protected void onSuccees(UpdateData model) throws Exception {
                        if (updataView != null) {
                            updataView.hideProgress();
                            updataView.getUpdata(model);
                        }
                    }

                    @Override
                    protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
//                        view.setContent("失败了----->"+e.getMessage());
                        if (updataView != null) {
                            updataView.hideProgress();
                            updataView.onError(e.toString());
                        }
                    }
                });
    }

    public String replaceBlank(String str) {
        String dest = "";
        if (str != null) {
            Pattern p = Pattern.compile("\\s*|\t|\r|\n");
            Matcher m = p.matcher(str);
            dest = m.replaceAll("");
        }
        return dest;
    }
}
